package com.xbaoziplus.simple_spring.beans.factory.config;

import com.xbaoziplus.simple_spring.beans.PropertyValues;

/**
 * @author xbaozi
 * @version 1.0
 * @classname BeanDefinition
 * @date 2023-04-17  16:55
 * @description Bean对象
 */
public class BeanDefinition {
    // 使用Class替换Object，避免直接将实例化信息注册到SpringBean容器中
    private Class beanClass;

    private PropertyValues propertyValues;

    public BeanDefinition(Class beanClass) {
        this.beanClass = beanClass;
        this.propertyValues = new PropertyValues();
    }

    public BeanDefinition(Class beanClass, PropertyValues propertyValues) {
        this.beanClass = beanClass;
        this.propertyValues = propertyValues != null ? propertyValues : new PropertyValues();
    }

    public Class getBeanClass() {
        return beanClass;
    }

    public void setBeanClass(Class beanClass) {
        this.beanClass = beanClass;
    }

    public PropertyValues getPropertyValues() {
        return propertyValues;
    }

    public void setPropertyValues(PropertyValues propertyValues) {
        this.propertyValues = propertyValues;
    }
}
